package com.feeyo.prophet.pojo.enums;

public enum RoleTypeEnum {
    //
    USER(0, "user"),
    SYSTEM(1, "system"),
    ASSISTANT(2, "assistant"),
    ;
    private final Integer code;

    private final String desc;


    RoleTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static RoleTypeEnum valueOf(Integer code) {
        for (RoleTypeEnum type : RoleTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }

}
